#ifndef RANSACIMAGEALIGNMENT_H
#define RANSACIMAGEALIGNMENT_H

#include "ransacbase.h"

#include "opencv2/core/core.hpp"

struct Pt2D
{
	double x;
	double y;
};

class RansacImageAlignment: public RansacBase<std::pair<Pt2D, Pt2D> >
{
 
 public:
	 RansacImageAlignment();
	 ~RansacImageAlignment();

private:	
	std::vector<double> computeSolution(std::vector<std::pair<Pt2D, Pt2D> >& samples);
	
	void nomalisePoints(
		const std::vector<std::pair<Pt2D, Pt2D> >& samples,
		std::vector<std::pair<Pt2D, Pt2D> >& samples_normalised,
		cv::Mat& T,
		cv::Mat& T_dash);

	void normalise(
		const std::vector<Pt2D>& points,
		cv::Mat& T);

	double evaluateSolution(std::vector<double>& solution, std::vector<int>& inliers);
};

 #endif // RANSACIMAGEALIGNMENT_H